/*
ID: icerupt1
PROG: subset
LANG: C++11
*/
#include <fstream>
#include <iostream>

std::ifstream fin {"subset.in" };
std::ofstream fout{"subset.out"};

int const maxn = 44;
int f[maxn][maxn*maxn/2];
int n;

int main()
{
	fin >> n;
	f[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j < (i+1)*i/2; j++) {
			f[i][j] = f[i-1][j];
			if (j >= i && f[i-1][j-i] != 0) f[i][j] += f[i-1][j-i];
		}
	}

	int t = n*(n+1)/2;
	if ((t&1) == 1) {
		std::cout << "0\n";
		fout << "0\n";
	} else {
		std::cout << f[n][t/2] << '\n';
		fout << f[n][t/2] << '\n';
	}
}
